package git.jas0nch.boottest.pojo;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.context.properties.ConfigurationProperties;
import org.springframework.stereotype.Component;

//import java.io.Serializable;
// implements Serializable
@Component
@ConfigurationProperties(prefix = "user") // need the dependency;
public class user {

//    @Value("jas0ch") 注释掉后用yaml 配置；
    private String username;
//    @Value("20")
//    @Email : jsr303 数据校验；
    private int age;

    public user(){}
    public user(String username, int age) {
        this.username = username;
        this.age = age;
    }

    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String toString() {
        return "user{" +
                "username='" + username + '\'' +
                ", age=" + age +
                '}';
    }
}
